CREATE TABLE [dbo].[TMPATR_NETO]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_CNTA_EMPR] [dbo].[TD_VC_020_CNTA] NOT NULL,
[NU_ANNO] [dbo].[TD_IN_004_ANNO] NULL CONSTRAINT [DF__TMPATR_NE__NU_AN__671F4F74] DEFAULT (datepart(year,getdate())),
[CO_TITU] [dbo].[TD_VC_003] NULL,
[NO_TITU] [dbo].[TD_VC_050] NULL,
[CO_COLU] [dbo].[TD_VC_003] NULL,
[NO_COLU] [dbo].[TD_VC_050] NULL,
[ST_TIPO] [dbo].[TD_VC_001] NULL,
[NU_ORDE] [dbo].[TD_IN_001] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPATR_NE__FE_US__690797E6] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TMPATR_NE__FE_US__69FBBC1F] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPATR_NETO] ADD CONSTRAINT [CK__TMPATR_NE__CO_CN__662B2B3B] CHECK (([CO_CNTA_EMPR]>='0' AND [CO_CNTA_EMPR]<='99999999999999999999'))
GO
ALTER TABLE [dbo].[TMPATR_NETO] ADD CONSTRAINT [CK__TMPATR_NE__NU_AN__681373AD] CHECK (([NU_ANNO]>=(0)))
GO
ALTER TABLE [dbo].[TMPATR_NETO] ADD CONSTRAINT [XPKTMPATR_NETO] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_CNTA_EMPR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TMPATR_NETO] ADD CONSTRAINT [TMPLAN_ANNO_A_TMPATR_NETO] FOREIGN KEY ([CO_EMPR], [CO_CNTA_EMPR]) REFERENCES [dbo].[TMPLAN_ANNO] ([CO_EMPR], [CO_CNTA_EMPR])
GO
